function foo() {
    var myname = '彭于晏'
    let test1 = 1
    const test2 = 2
    var innerBar = {
      setName: function (name) {
        myname = name
      },
      getName: function () {
        console.log(test1);
        return myname
      }
    }
    return innerBar
  }
  var bar = foo()
  bar.setName('金城武')
  console.log(bar.getName());